package com.vinci.pdf.controller;

import com.vinci.pdf.service.api.PdfGenerateTestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;


/**
 * @package: com.vinci.pdf.controller
 * @className: PdfGenerateTestController
 * @author: Vinci
 * @description:pdf生成测试controller
 * @date: 2023/11/13 10:16
 */
@RestController
@RequestMapping("/pdf")
public class PdfGenerateTestController {

    /**
     * @description: 日志打印
     **/
    private static final Logger log = LoggerFactory.getLogger(PdfGenerateTestController.class);

    /**
     * @description: 业务接口
     **/
    @Resource
    private PdfGenerateTestService pdfGenerateTestService;

    /**
     * @description: 测试pdf生成
     * @author: Vinci
     * @date: 2023/11/13 10:17
     **/
    @GetMapping(value = "/generate")
    public void pdfGenerate(HttpServletResponse response){
        try{
            pdfGenerateTestService.pdfGenerate(response);
        }catch (Exception e){
            log.error("发现异常",e);
        }
    }


}
